//
//  Car.m
//  Audit
//
//  Created by fenggu07 on 15/2/9.
//  Copyright (c) 2015年 cc. All rights reserved.
//

#import "Car.h"

@implementation Car

- (id)initWithInfo:(NSDictionary *)info {
    
    if (!info && [info isKindOfClass:[NSDictionary class]]) {
        return nil;
    }
    
    self = [super init];
    
    if (self) {
        self.vehicleId      = [info objectForKey:@"vehicleId"];//CARpkID
        self.series         = [info objectForKey:@"series"];//生产车型
        self.seriesDesc     = [info objectForKey:@"seriesListDesc"];//生产车型
        self.model          = [info objectForKey:@"model"];//生产配置
        self.modelDesc      = [info objectForKey:@"modelListDesc"];//生产配置
        self.vin            = [info objectForKey:@"vin"];//VIN
        self.transmission   = [info objectForKey:@"transmission"];//变速箱
        self.color          = [info objectForKey:@"color"];//颜色
        self.drivedirection = [info objectForKey:@"drivedirection"];//驾驶方向
        self.defect_info    = [info objectForKey:@"defect_info"];//重点缺陷
        self.repair_info    = [info objectForKey:@"repair_info"];//返修信息
        self.engine         = [info objectForKey:@"engine"];//引擎
        self.plant          = [info objectForKey:@"plant"];//检查地点
        self.plantDesc      = [info objectForKey:@"plantListDesc"];//检查地点
        self.domain         = [info objectForKey:@"domain"];//生产基地
        self.domainDesc     = [info objectForKey:@"domainListDesc"];//生产基地
        self.auditGroup     = [info objectForKey:@"auditGroup"];//检查组
        self.auditGroupDesc = [info objectForKey:@"auditGroupListDesc"];//检查组
        self.shiftDate      = [info objectForKey:@"shiftDate"];//检查日期
        self.buildDate      = [info objectForKey:@"buildDate"];//生产日期
        self.csn            = [info objectForKey:@"csn"];//生产序号
        self.phase          = [info objectForKey:@"phase"];//生产阶段
        self.level          = [info objectForKey:@"level"]?[info objectForKey:@"level"]:@"0.0";//等级
        self.totalScore     = [info objectForKey:@"totalScore"]?[info objectForKey:@"totalScore"]:@"0";//总分值
        self.phaseDesc      = [info objectForKey:@"phaseListDesc"];//生产阶段
//        self.listDefect     = [info objectForKey:@""];//缺陷
    }
    
//    if ([self.csn isKindOfClass:[NSString class]]) {
//        NSLog(@"%@",self.csn);
//    }
    
    return self;
}

@end
